package com.thermofisher.dsc.amanda.tracking.controller;

import com.thermofisher.dsc.amanda.model.dto.tracking.TrackingDto;
import com.thermofisher.dsc.amanda.model.response.BaseResponse;
import com.thermofisher.dsc.amanda.model.response.DataResponse;
import com.thermofisher.dsc.amanda.tracking.service.TrackingService;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wenjie.yang on 3/29/2019.
 */
@RestController
@RequestMapping("/api/tracking")
public class TrackingController {

  @Autowired
  private TrackingService trackingService;

  @PostMapping
  public BaseResponse tracking(@RequestBody Map<String,Object> param){
    String action = param.get("action").toString();
    return new DataResponse(trackingService.createByAction(param));
  }


}
